package edu.jd.movieplatform.user.order.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;

public interface OrderDao {

    @Insert("insert into orders(order_num, cust_username, order_time)" +
            "values(#{order_num}, #{cust_username}, #{order_time})")
    public void insertOrder(@Param("order_num")int order_num,
                            @Param("cust_username")String cust_username,
                            @Param("order_time")Date order_time);

    @Select("select max(order_num) from orders")
    public Integer getMaxOrder_num();
}
